how to access attributes of an element